package com.tencent.txcc.exception;

import com.tencent.txcc.enums.GlobleExceptionCode;
import lombok.Data;

@Data
public class BusinessException extends RuntimeException{

    private String errorMessage;
    private String errorCode;

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String errorMessage, String errorCode) {
        super(errorMessage);
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;
    }

    public BusinessException(GlobleExceptionCode globleExceptionCode) {
        super(globleExceptionCode.getMessage());
        this.errorMessage = globleExceptionCode.getMessage();
        this.errorCode = globleExceptionCode.getCode();
    }
}
